package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * @Author ZhaoQiuWei
 * @Date 2021/10/26 17:15
 */
@Component
public class ExportRiskFactorConvertor implements FieldValueConvert<String, String> {
    @Override
    public String convert(Object bean, String value, DataDumpField dataField) {
        if (StringUtils.isNotBlank(value)) {
            return StringUtils.join(JSONArray.parseArray(value.trim(), String.class), ",");
        }
        return null;
    }
}
